{% extends "userpage.html" %}

{% block title %}Manage Accounts - {{super()}}{% endblock %}

{% block body %}

<h3>Manage Accounts</h3>

<div class="wide-table">
<table id="accounts-table">
		<tr>
		# for h in ['Username','Email','Name','Phone','Address','Last Activity','Created']
			<th>{{h}}</th>
		# endfor
		</tr>
		# for auser in users
			<tr class="row-{{loop.cycle('odd', 'even')}}">
				<td>
					<a href="/accounts/edit?u={{auser.key()}}">{{auser.username}}</a>
					# if auser.admin
						<img src="/images/supercow-mini.gif" alt="(Admin Account)" title="This user has super cow powers!"
							width="20" height="17" style="vertical-align:middle;" />
					# endif
				</td>
				<td>{{auser.email}}</td>
				<td>{{auser.name or '-'}}</td>
				<td>{{auser.phone or '-'}}</td>
				<td>{{auser.address or '-'}}</td>
				<td>{{auser.last_activity|as_time_ago}}</td>
				<td>{{localtime(auser.created).strftime('%Y-%m-%d')}}</td>
			</tr>  
		# endfor
</table>
</div>
<script type="text/javascript">$("td:last-child").css("border-right", "0px");</script>

<a href="/accounts/new" class="plus1">New Account</a>

<br /><br />
<hr />

<label for="emails">Need to send an email to every buyer?
&nbsp; Copy their addresses from below and send a <a href="http://en.wikipedia.org/wiki/Blind_carbon_copy">BCC</a> email.</label><br />
<textarea id="emails" style="width:100%;height:60px;" onfocus="$(this).select();" onclick="$(this).select();">{% for auser in users if not auser.admin %}{{auser.display_email()}}{% if not loop.last %}, {% endif %}{% endfor %}</textarea>



{% endblock %}
